import java.util.ArrayList;

import KnowledgeBase.Axiom;
import KnowledgeBase.Axioms;
import KnowledgeBase.KnowledgeBase;
import KnowledgeBase.Methods;
import KnowledgeBase.Operator;
import KnowledgeBase.Operators;
import State.WorldState;
import Task.Task;
import Task.Tasks;

/**
 * prototype for the SHOP ai to be used in radadventure
 * @author Brandon
 *
 */

public class Main {
	
	public static void main(String[] args){
		
//		KnowledgeBase kb = new KnowledgeBase(new Axioms("defaults"), new Operators("defaults"),
//				new Methods("defaults"));		
		
		InputExtractor input = new InputExtractor("testinput.xml");//.extract();
		
		ArrayList<Task> tasks = input.extract();
		WorldState state = new WorldState();
		
		System.out.println("\n\n\nBEFORE\n=====");
		for (int i = 0; i < tasks.size(); i++){
			System.out.println(tasks.get(i).toString());
		}
		System.out.println("\n");
		
		SHOP htn = new SHOP();
		htn.run(state, tasks);
		
		ArrayList<Task> plan = htn.getPlan();
		
		System.out.println("\n\n\nAFTER\n=====");
		for (int i = 0; i < plan.size(); i++){
			System.out.println(plan.get(i).toString());
			System.out.println("\t"+plan.get(i).getContent());
		}
	}
	
}
